import api.Impl.CreditCardPayment;
import api.Impl.WxPayment;

public class StrategyPatternDemo {
    public static void main(String[] args) {
        // 使用信用卡支付
        PaymentContext context = new PaymentContext(new CreditCardPayment("1234-5678-9012-3456"));
        context.executePayment(100);

        // 切换到Wx支付
        context.setStrategy(new WxPayment("13112345678"));
        context.executePayment(200);
    }
}
